package com.wanwu.channel.dao.inter;

import com.wanwu.channel.dao.condition.BaseCondition;
import com.wanwu.channel.dao.entity.ChannelRefundEntity;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ChannelRefundDao {



    int insert(ChannelRefundEntity record);

    int insertSelective(ChannelRefundEntity record);

    ChannelRefundEntity selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ChannelRefundEntity record);

    int updateByPrimaryKey(ChannelRefundEntity record);

    ChannelRefundEntity selectByOutReturnAndTradeNoAndPayType(String outReturnNo, String tradeNo, int payType);

    int updateNotify(String notifyStatus, String notifyData, int finalRefundFee, Date refundSuccessTime, Date updateTime, String notifyId,
                     int refundStatus, String outReturnNo, String outTradeNo, int payType);


    int updateErrorNotify(String refundStatus, String notifyData, Date updateTime, String notifyId, String errorCode,
                          String errorMsg, int channelRefundStatus, String outReturnNo, String outTradeNo, int payType);

    ChannelRefundEntity selectOneByRefundNo(@Param("outRefundNo") String outRefundNo);

    ChannelRefundEntity selectByBizRefundNo(@Param("bizRefundNo") String bizRefundNo, @Param("bizCode") String bizCode);

    ChannelRefundEntity selectByBizRefundNoFMaster(@Param("bizRefundNo") String bizRefundNo, @Param("bizCode") String bizCode);

    ChannelRefundEntity selectByChannelNo(@Param("channelNo") String channelNo);

    ChannelRefundEntity selectByChannelNoFMaster(@Param("channelNo") String channelNo);

    int updateWithResp(@Param("item") ChannelRefundEntity channelRefundEntity);

    //自定义sql
    ChannelRefundEntity selectByRefundNoAndBizOrderNo(String bizRefundNo, String bizOrderNo);

    ChannelRefundEntity selectByRefundNoAndBizOrderNoFMaster(String bizRefundNo, String bizOrderNo);

    //临时刷数 sql
    List<ChannelRefundEntity> qryMerchantNoEmptyList(@Param("id") Long id);

    List<ChannelRefundEntity> queryList(@Param("entity") ChannelRefundEntity entity, @Param("cond") BaseCondition condition);

}